package com.example.finalsystem.Dao;

import com.example.finalsystem.Entity.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {


//    用户
    @Select("select * from `uml_user` where userid = #{userId}")
    User getUserByUserId(String userId);
    @Select("select * from `uml_user` where userid = #{userId}")
    @Results({
            @Result(property = "deals",column = "userId",
            many = @Many(select = "com.example.finalsystem.Dao.DealMapper.findStaffIdByStaffId" ))
    })
    User getUserByDeal(String userId);
//    以上是一对多方法
    List<User> getListOfUser(int currentPage,int pageSize);

    int countMember();

    int deleteByPrimaryKey(String userid);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String userid);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
}